package com.bumptech.glide.request.transition;

import com.bumptech.glide.load.DataSource;

/**
 * A factory class that can produce different {@link Transition}s based on the state of the
 * request.
 * <p>
 * 基于请求状态可以生产不同的{@link Transition}实例的工厂类
 *
 * @param <R> The type of resource that needs to be animated into the target.
 */
public interface TransitionFactory<R> {

    /**
     * Returns a new {@link Transition}.
     *
     * @param dataSource      The {@link DataSource} the resource was loaded
     *                        from.
     * @param isFirstResource True if this is the first resource to be loaded into the target.
     */
    Transition<R> build(DataSource dataSource, boolean isFirstResource);
}
